package com.enjoy.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
@Slf4j
public class UserController {
    @Autowired
    private RestTemplate restTemplate;

    @RequestMapping("userInfo")
    public String queryUser() {
        System.out.println("业务逻辑");
        String result = restTemplate.getForObject("http://micro-order/queryOrder", String.class);
        log.info("result:" + result);
        return result;
    }
}
